home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / tchelp.arc / TC.DAT < prev    next >
Text File  |  1987-06-08  |  76KB  |  2,201 lines

  1. :abort
  2.     void abort()
  3.     - terminates process & calls exit(3)
  4.     - needs stdlib.h, process.h
  5.  
  6. :abs
  7.     int abs(n)
  8.     int n;
  9.     - returns absolute value of int n
  10.     - needs stdlib.h
  11.  
  12. :absread
  13.     int absread(drive,nsects,sectno,buffer)
  14.     int drive,int nsects,int sectno,void *buffer;
  15.     - reads disk absolute logical sectors
  16.     - drive  = 0(A), 1(B), etc
  17.     - nsects = # of sectors to read
  18.     - sectno = beginning logical sector number
  19.     - buffer = address of buffer
  20.     - returns 0 if OK; -1 on error; 'errno' = DOS error number
  21.     - needs dos.h
  22.  
  23. :abswrite
  24.     int abswrite(drive,nsects,sectno,buffer)
  25.     int drive,int nsects,int sectno,void *buffer;
  26.     - writes disk absolute logical sectors
  27.     - drive  = 0(A), 1(B), etc
  28.     - nsects = # of sectors to write
  29.     - sectno = beginning logical sector number
  30.     - buffer = address of buffer
  31.     - returns 0 if OK; -1 on error; 'errno' = DOS error number
  32.     - needs dos.h
  33.  
  34. :access
  35.     int access(filename,amode)
  36.     char *filename, int amode;
  37.     - checks 'filename' for existence & R/W access
  38.     - amode = 06 -- check for R/W permission
  39.               04 -- check for R
  40.               02 -- check for W
  41.               01 -- execute (ignored)
  42.               00 -- check if filename exists
  43.     - 'filename' can be directory
  44.     - returns 0 if OK; -1 on error; 'errno' = ENOENT if path or filename
  45.       not found & 'errno' = EACCES if permission denied
  46.     - needs io.h
  47.  
  48. :acos
  49.     double acos(x)
  50.     double x;
  51.     - needs math.h
  52.  
  53. :asctime
  54.    char *asctime(struct tm *tm)
  55.    - converts time in struct tm to 26-character string
  56.    - needs time.h
  57.    - returns pointer to string
  58.  
  59. :allocmem
  60.     int allocmem(size,seg)
  61.     unsigned size, unsigned *seg;
  62.     - allocates memory in 'size' paragraphs, where 'seg' is pointer to
  63.       a word containing segment address
  64.     - returns -1 if ok, else largest available memory in paragraphs 
  65.     - needs dos.h
  66.  
  67. :asctime
  68.     char *asctime(struct tm *tm)
  69.     - converts date & time to ASCII
  70.     - needs time.h
  71.  
  72. :asin
  73.     double asin(x)
  74.     double x;
  75.     - needs math.h
  76.  
  77. :assert
  78.     void assert(int test)
  79.     - if 'test' fails, prints error message & aborts program
  80.     - 'test' can be a condition
  81.     - needs assert.h
  82.  
  83. :atan
  84.     double atan(x)
  85.     double x;
  86.     - needs math.h
  87.  
  88. :atan2
  89.     double atan(y,x)
  90.     double y, double x;
  91.     - needs math.h
  92.  
  93. :atexit
  94.     int atexit(atexit_t func)
  95.     - calls 'func' before exiting to DOS
  96.     - up to 32 functions can be called (32 atexit calls needed)
  97.     - should be located in 'main' & executed before anything else
  98.     - returns 0 if OK, else nonzero if no space to register function
  99.     - needs stdlib.h
  100.  
  101. :atof
  102.     double atof(s)
  103.     char *s;
  104.     - needs math.h or stdlib.h
  105.  
  106. :atoi
  107.     int atoi(s)
  108.     char *s;
  109.     - needs stdlib.h
  110.  
  111. :atol
  112.     long atol(s)
  113.     char *s;
  114.     - needs stdlib.h
  115.  
  116. :bdos
  117.     int bdos(dosfun, dosdx, dosal)
  118.     int dosfun, unsigned dosdx, unsigned dosal;
  119.     - make DOS system call for function 'dosfun', passing DX and AL
  120.       values via 'dosdx' and 'dosal'
  121.     - use only in small memory model
  122.     - needs dos.h
  123.     - returns value of AX set by system call
  124.  
  125. :bdosptr
  126.     int bdosptr(dosfun, argument, dosal)
  127.     int dosfun, void *argument, unsigned dosal;
  128.     - make DOS system call for function 'dosfun', passing POINTER to
  129.       values via 'argument' and passing AL via 'dosal'
  130.     - use for small or large memory models
  131.     - needs dos.h
  132.     - returns value of AX set by system call if OK, else -1 on failure
  133.       (where 'errno' & '_doserrno' are then set)
  134.  
  135. :bioscom
  136.     int bioscom(cmd,byte,port)
  137.     int cmd, char byte, int port;
  138.     - RS232 communications
  139.     - needs bios.h
  140.     - cmd = 0 to set comm parms to value in 'byte'
  141.             1 to send char in 'byte' out on RS232 line
  142.             2 to receive char
  143.             3 to return current port status
  144.     - port = 0 for COM1, 1 for COM2, etc
  145.     - byte = bitwise OR of following bits
  146.              0x02 for 7 data bits   0x00     1 stop bit
  147.              0x03     8 data bits   0x04     2 stop bits
  148.         0x00 == no parity; 0x08 == odd parity; 0x18 == even parity
  149.              0x00     110 bps       0x20     150 bps
  150.              0x40     300 bps       0x60     600 bps
  151.              0x80     1200 bps      0xa0     2400 bps
  152.              0xc0     4800 bps      0xe0     9600 bps 
  153.     - returns 16-bit integer, upper 8 bits are status & lower 8 bits
  154.       depend on 'cmd' sent
  155.         15 = timeout  14 = TSR empty  13 = THR empty  12 = break detect
  156.         11 = frame err  10 = parity err  09 = overrun err  08 = data rdy
  157.       'cmd' = 1 & bit 15 =1 ==> 'byte' was not transmitted
  158.       'cmd' = 2 ==> lower 8 bits = char received
  159.       'cmd' = 0 or 3, then lower 8 bits are:
  160.         07 = received line signal detect  06 = ring indicator
  161.         05 = DSR  04 = CTS  03 = delta receive line signal detect
  162.         02 = trailing edge ring detect  01 = delta DSR  00 = delta CTS
  163.  
  164. :biosdisk
  165.     int biosdisk(cmd,drive,head,track,sector,nsects,buffer)
  166.     int cmd, drive, head, track, sector, nsects; 
  167.     void *buffer;
  168.     - issues interrupt 0x13 for BIOS disk operations
  169.     - needs bios.h
  170.     - drive = 0 (floppy drive 1), 1 (floppy drive 2), etc
  171.             = 0x80 (hard drive 1), 0x82 (hard drive 2), etc
  172.     - cmd = 0 - reset diskette system (hard disk drive reset)
  173.             1 - return status of last disk operation & other parms ignored
  174.             2 - read 'nsects' disk sectors, with starting sector defined
  175.                 by 'head', 'track', & 'sector', reading 512 bytes per
  176.                 sector into 'buffer'
  177.             3 - write 'nsects' disk sectors, with starting sector defined
  178.                 by 'head', 'track', & 'sector', writing 512 bytes per
  179.                 sector from 'buffer'
  180.             4 - verify 'nsects' disk sectors, with starting sector defined
  181.                 by 'head', 'track', & 'sector'
  182.             5 - format a track defined by 'head' & 'track', where 'buffer'
  183.                 points to a table of sector headers to be written
  184.        for XT or AT only:
  185.             6 - formats a track & sets bad sector flags
  186.             7 - formats drive beginning at specific track
  187.             8 - returns current drive parms in 'buffer' as 1st 4 bytes
  188.             9 - initializes drive-pair characteristics
  189.             10 - long read (512 + 4 extra bytes per sector)
  190.             11 - long write (512 + 4 extra bytes per sector)
  191.             12 - disk seek
  192.             13 - alternate disk reset
  193.             14 - reads sector buffer
  194.             15 - writes sector buffer
  195.             16 - tests if named drive is ready
  196.             17 - recalibrates drive
  197.             18 - controller ram diagnostic
  198.             19 - drive diagnostic
  199.             20 - controller internal diagnostic
  200.     - returns status byte equal to:
  201.       0x00 == OK             0x01 == bad cmd       0x02 == Addr mark not found
  202.       0x04 == rec not found  0x05 == reset failed  0x07 == drive parm failed
  203.       0x09 == DMA/64K error  0x0b == bad trk flag  0x10 == bad ECC on read
  204.       0x11 == ECC done (OK)  0x20 == ctrllr dead   0x40 == seek failed
  205.       0x80 == no response    0xbb == unknown error 0xff == sense op failed
  206.  
  207. :biosequip
  208.     int biosequip()
  209.     - returns integer showing equipment in system
  210.     - needs bios.h
  211.     - values returned are:
  212.       bits 15,14 == no of printers bit 13 == not used
  213.       bit 12 == game port          bits 11,10,09 == no of RS232 ports
  214.       bit 08 == not used           bits 07,06 == no of diskettes
  215.                                    00 = 1 dr; 01 = 2 dr; 10 = 3 dr; 11 = 4 dr
  216.       bits 05,04 == init video mode (00=na; 01=40x25co; 10=80x25bw; 11=mono)
  217.       bits 03,02 == ram (00=16k; 01=32k; 10=48k; 11=64k)
  218.       bit 01 == 8087 installed     bit 00 == boot from diskette
  219.  
  220. :bioskey
  221.     int bioskey(cmd)
  222.     int cmd;
  223.     - keyboard operations
  224.     - needs bios.h
  225.     - 'cmd' = 0 == return next keystroke (no echo); if extended, = 0
  226.             = 1 == test if key hit (0= no, else value)
  227.             = 2 == return shift key status, where value is OR of:
  228.                 0x80 insert toggled   0x40 caps toggled  0x20 num lock toggled
  229.                 0x10 scrl lck toggled 0x08 ALT down      0x04 CTRL down
  230.                 0x02 left shift down  0x01 right shift down
  231.  
  232. :biosmemory
  233.     int biosmemory()
  234.     - returns BIOS memory in 1K blocks
  235.     - needs bios.h
  236.  
  237. :biosprint
  238.     int biosprint(cmd, byte, port)
  239.     int cmd, byte, port;
  240.     - outputs 'byte' to 'port'
  241.     - needs bios.h
  242.     - 'port' = 0 (LPT1), 1 (LPT2), etc
  243.     - 'cmd' = 0 (print 'byte'); 1 (init printer port); 2 (get LPT status)
  244.     - returns status of OR of:
  245.       0x01 time out (cmd=0 means output error)
  246.       0x08 I/O error   0x10 selected   0x20 out of paper
  247.       0x40 acknowledge 0x80 not busy
  248.  
  249. :biostime
  250.     int biostime(cmd, newtime)
  251.     int cmd; 
  252.     long newtime;
  253.     - reads or sets BIOS timer
  254.     - needs bios.h
  255.     - cmd = 0 == returns current value of timer
  256.             1 == sets timer to value of 'newtime'
  257.  
  258. :brk
  259.     int brk(endds)
  260.     void *endds;
  261.     - dynamically changes the amount of space allocated to the calling
  262.       program's data segment.  Amount of allocated space increases as
  263.       the break value increases. 
  264.     - returns 0 if OK; else -1 & 'errno' is set to ENOMEM
  265.  
  266. :bsearch
  267.    void *bsearch(key,base,nelem,width,fcmp)
  268.    void *key, void *base, int *nelem, int width, int (*fcmp)();
  269.    - does binary search for items in a table which is ALREADY sorted in
  270.      ascending order
  271.    - 'base' points to 0th element of table
  272.    - 'nelem' points to integer containing number of entries in table
  273.    - 'width' contains number of bytes in each entry
  274.    - 'key' points to the search key
  275.    - 'fcmp' points to user-written comparison routine, where 'key' and
  276.      'elem' are passed to it as pointers.  'fcmp' returns integer < 0
  277.      if search key > *elem; integer = 0 if equal; else integer > 0
  278.      if search key < *elem
  279.    - returns 0 if no match found, else address of first entry that matches
  280.    - needs stdlib.h
  281.  
  282. :cabs
  283.     double cabs(z)
  284.     struct complex z;
  285.     - returns absolute value of int n
  286.     - needs math.h
  287.  
  288. :calloc
  289.     void *calloc(count, sizeEach)
  290.     unsigned count, sizeEach;
  291.     - allocates main memory
  292.     - stdlib.h & alloc.h
  293.     - see malloc
  294.  
  295. :ceil
  296.     double ceil(x)
  297.     double x;
  298.     - rounds up 'x'
  299.     - math.h
  300.  
  301. :cgets
  302.     char *cgets(s)
  303.     char *s;
  304.     - reads string from console, deletes CR & substitutes '\0' as tail
  305.     - CR/LF combination is replaced by '\0'
  306.     - conio.h
  307.     - see gets
  308.  
  309. :chdir
  310.    int chdir(path)
  311.    char *path;
  312.    - changes current working directory to 'path'.  Drive can be specified
  313.      also.
  314.    - returns 0 if OK; else -1 with 'errno' set to ENOENT
  315.  
  316. :_chmod
  317.    #include <dos.h>
  318.    int _chmod(char *filename, int func [,int attrib]);
  319.    - if 'func' = 0, returns access mode of file
  320.    - if 'func' = 1, sets access mode of file
  321.    - 'attrib' = FA_RDONLY, FA_HIDDEN, or FA_SYSTEM (defined in dos.h)
  322.    - if 'func' = 1, returns 0 if OK; else -1 & 'errno' set to ENOENT or EACCES
  323.    - if 'func' = 0, returns MSDOS attribute
  324.    - io.h
  325.  
  326. :chmod
  327.    #include <sys\stat.h>
  328.    int chmod(char *filename, int permiss);
  329.    - changes access mode of file according to mask given by 'permiss', where
  330.      'permiss' = S_IWRITE, S_IREAD, or S_IWRITE | S_IREAD
  331.    - returns 0 if OK; else -1 & 'errno' set to ENOENT or EACCES
  332.    - io.h
  333.  
  334. :_clear87
  335.     unsigned int _clear87()
  336.     - clears 8087/80287 status word & other exceptions
  337.     - float.h
  338.     - returns old status word
  339.  
  340. :clearerr
  341.     #include <stdio.h>
  342.     void clearerr(FILE *stream);
  343.     - resets error indication
  344.     - stdio.h
  345.     - see ferror()
  346.  
  347. :_close
  348. :close
  349.     int _close(int fd)
  350.     int close(int fd)
  351.     - closes file 'fd' where 'fd' is file handle from _creat(), creat(),
  352.       creatnew(), creattemp(), dup(), dup2(), _open(), or open().
  353.     - use fdopen() to change file handle to file stream.
  354.     - _close() does not write a CTL-Z to a text file on closing, while close()
  355.       does.
  356.     - returns 0 if OK; else -1 & 'errno' may be set of EBADF
  357.  
  358. :coreleft
  359.     unsigned coreleft()  -- tiny, small, medium memory models
  360.     unsigned long coreleft() -- compact, large, huge memory models
  361.     - returns a measure of unused memory (see malloc())
  362.     - alloc.h
  363.  
  364. :cos
  365.     double cos(x)
  366.     double x;
  367.     - math.h
  368.  
  369. :cosh
  370.     double cosh(x)
  371.     double x;
  372.     - math.h
  373.  
  374. :country
  375.     #include <dos.h>
  376.     struct country *country(int countrycode, struct country *countryp)
  377.     - returns country-dependent information
  378.  
  379. :cprintf
  380.     int cprintf(char *format[,argument,...]);
  381.     - sends formatted output to the console
  382.     - conio.h
  383.  
  384. :cputs
  385.     void cputs(s)
  386.     char *s;
  387.     - needs conio.h
  388.     - writes string 's' to console (not to stdout)
  389.  
  390. :_creat
  391.    #include <dos.h>
  392.    int _creat(char *filename, int attrib);
  393.    - creates new file (overwrites existing file) of 'filename' with
  394.      file attribute 'attrib', for both read/write
  395.    - file is created set to '_fmode' (O_TEXT or O_BINARY)
  396.    - returns nonnegative integer if OK, else -1
  397.    - needs io.h
  398.  
  399. :creat
  400.    #include <sys\stat.h>
  401.    int creat(filename,permis)
  402.    char *filename;
  403.    int  permis;
  404.    - creates new file (overwrites existing file) of 'filename' with 
  405.      access permission 'permis' which is S_IWRITE, S_IREAD, or
  406.      S_IWRITE | S_IREAD, for permission to write, read or read/write.
  407.    - file is created set to '_fmode' (O_TEXT or O_BINARY)
  408.    - needs io.h
  409.  
  410. :creatnew
  411.    #include <dos.h>
  412.    int creatnew(filename,attrib)
  413.    char *filename;
  414.    int  attrib;
  415.    - creates new file 'filename' with file attribute 'attrib'
  416.    - returns nonnegative integer if OK, else -1
  417.    - returns error if 'filename' already exists
  418.    - file is created set to '_fmode' (O_TEXT or O_BINARY)
  419.    - needs io.h
  420.  
  421. :creattemp
  422.    #include <dos.h>
  423.    int creattemp(char *filename, int attrib);
  424.    - creates new file (overwrites existing file) of 'filename' with
  425.      file attribute 'attrib', for both read/write
  426.    - 'filename' is a path name ending in a backslash (\); when file
  427.      is created, 'filename' has a unique path name
  428.    - file is created set to '_fmode' (O_TEXT or O_BINARY)
  429.    - returns nonnegative integer if OK, else -1
  430.    - needs io.h
  431.  
  432. :cscanf
  433.    int cscanf(char *format[,argument,...])
  434.    - performs formatted input from console
  435.    - needs conio.h
  436.    - see scanf()
  437.  
  438. :ctime
  439.    char *ctime(long *clock)
  440.    - converts date and time to a string
  441.    - 'clock' is a long integer (such as that returned by time())
  442.    - generates a 26-character string for date and time
  443.    - needs time.h
  444.    - returns pointer to string
  445.  
  446. :ctrlbrk
  447.    void ctrlbrk(int (*fptr)(void))
  448.    - needs dos.h
  449.    - sets a new control-break handler function pointed to by 'fptr'
  450.    - if CNTL-C hit, then function pointed to by 'fptr' is called
  451.    - use longjmp() to return to a given point in the program
  452.  
  453. :difftime
  454.    double difftime(time_t time2, time_t time1)
  455.    - returns (time2-time1) difference in seconds (double)
  456.    - needs time.h
  457.  
  458. :disable
  459.    #include <dos.h>
  460.    void disable()
  461.    - disables all interrupts except NMI
  462.  
  463. :dosexterr
  464.    #include <dos.h>
  465.    int dosexterr(struct DOSERR *eblkp)
  466.    - returns extended error information (unique to MSDOS 3.x)
  467.    - 'eblkp' is pointer to DOSERR structure (defined in dos.h)
  468.    - if 0 returned, previous DOS call did not result in error
  469.  
  470. :dostounix
  471.    #include <dos.h>
  472.    long dostounix(struct date *dateptr,struct time *timeptr)
  473.    - converts date (as from getdate) and time (as from gettime) into
  474.      UNIX format
  475.  
  476. :dup
  477.    int dup(int handle)
  478.    - needs io.h
  479.    - returns a new file handle that duplicates the old 'handle'
  480.    - returns -1 on error
  481.  
  482. :dup2
  483.    int dup2(int oldhandle,int newhandle)
  484.    - needs io.h
  485.    - returns a new file handle that duplicates the old 'handle'
  486.      equal to 'newhandle'.  If 'newhandle' exists, the corresponding
  487.      file is closed.
  488.    - returns -1 on error
  489.  
  490. :ecvt
  491.    char *ecvt(double value, int ndigit, int *decpt, int *sign)
  492.    - needs stdlib.h
  493.    - converts a floating pt number to a string of 'ndigit' digits,
  494.      returning pointer to that string
  495.    - 'decpt' is position of decimal point (negative value means to
  496.      left of returned digits) and 'sign' is 0 if positive, else negative
  497.  
  498. :enable
  499.    #include <dos.h>
  500.    void enable()
  501.    - enables all interrupts
  502.  
  503. :eof
  504.    int eof(handle)
  505.    int *handle;
  506.    - needs io.h
  507.    - returns 1 if end of file for file associated with 'handle',
  508.      else 0 if not end of file; else -1 if bad file number
  509.  
  510. :exec...
  511.     int execl(pathname,arg0,arg1,arg2,...,argN,NULL);
  512.     int execle(pathname,arg0,arg1,arg2,...,argN,NULL,envp);
  513.     int execlp(pathname,arg0,arg1,arg2,...,argN,NULL);
  514.     int execlpe(pathname,arg0,arg1,arg2,....,argN,NULL,envp);
  515.     char *pathname,*arg0,*arg1,*arg2,....,*argN,*envp[];
  516.  
  517.     int execv(pathname,arg,NULL);
  518.     int execve(pathname,arg,NULL,envp);
  519.     int execvp(pathname,arg,NULL);
  520.     int execvpe(pathname,arg,NULL,envp);
  521.     char *pathname,*arg[],*envp[];
  522.  
  523.     - needs process.h
  524.     - loads and runs child processes
  525.     - 'pathname' search based on MS-DOS search algorithm
  526.       o if no extension or period - search for exact file name -
  527.         if not found, add .exe and search again
  528.       o if extension given, search only for exact file name
  529.       o if period given, search for file name with no extension
  530.     - arg0 can be the same as the 'pathname'
  531.     - at least one argument must be passed
  532.     - combined argument list cannot exceed 128 bytes
  533.     - execl..: arg0, arg1,...,argN are passed as SEPARATE arguments
  534.     - execv..: arg[0], arg[1],...,arg[N] are passed as ARRAYs of arguments
  535.     - execlp, execlpe, execvp, execvpe: search for child in DOS PATH
  536.     - returns no value if OK, else returns -1, and 'errno' set to E2BIG (too
  537.       many args), EACCES (permission denied), EMFILE (too many open files),
  538.       ENOENT (path or file not found), ENOEXEC (exec format error), or
  539.       ENOMEM (not enough memory).
  540.     - if successful, there is no return to the caller; the caller is
  541.       killed off
  542.  
  543. :exit
  544.     void exit(completionCode)
  545.     int completionCode;
  546.     - needs process.h
  547.     - terminates program, closes all files, buffered output is written, and
  548.       any registered exit functions (via atexit()) are called
  549.  
  550. :_exit
  551.     void _exit(completionCode)
  552.     int completionCode;
  553.     - needs process.h
  554.     - terminates program, BUT doesn't close all files, write out buffered 
  555.       output, and NO registered exit functions (via atexit()) are called
  556.  
  557. :exp
  558.     double exp(x)
  559.     double x;
  560.     - needs math.h
  561.     - returns y = e**x or HUGE_VAL on error
  562.  
  563. :fabs
  564.     double fabs(x)
  565.     double x;
  566.     - needs math.h
  567.     - returns absolute value of 'x'
  568.  
  569. :farcalloc
  570.     void far *farcalloc(unsigned long nunits, unsigned long unitsz);
  571.     - needs alloc.h
  572.     - allocates memory from the far heap for an array of 'nunits' elements,
  573.       each 'unitsz' bytes long
  574.     - returns pointer to allocated block or NULL if not enough space left
  575.     - can allocate all of memory & chunks bigger than 64K
  576.     - must use far pointers
  577.  
  578. :farcoreleft
  579.     long farcoreleft()
  580.     - needs alloc.h
  581.     - returns unused memory in bytes beyond highest allocated block
  582.  
  583. :farfree
  584.     void farfree(void far *block)
  585.     - needs alloc.h
  586.     - frees block of previously allocated far memory ('block' must be
  587.       allocated by 'farcalloc')
  588.  
  589. :farrealloc
  590.     void far *farrealloc(block,newsize)
  591.     void far *block;
  592.     unsigned long newsize;
  593.     - adjusts size of allocated block to 'newsize', copying contents to
  594.       a new location if necessary
  595.     - returns pointer to reallocated block or NULL on error
  596.  
  597. :fcvt
  598.    char *fcvt(double value, int ndigit, int *decpt, int *sign)
  599.    - needs stdlib.h
  600.    - converts a floating pt number to a string of 'ndigit' digits,
  601.      returning pointer to that string
  602.    - correct digit is rounded for Fortran-F format output of the
  603.      number of digits equal to 'ndigit'
  604.    - 'decpt' is position of decimal point (negative value means to
  605.      left of returned digits) and 'sign' is 0 if positive, else negative
  606.  
  607. :fclose
  608.     int fclose(fd)
  609.     FILE *fd;
  610.     - closes a file stream (see fdopen() to convert handle to stream)
  611.     - generally flushes buffers, too
  612.     - returns 0 on success or EOF on error
  613.  
  614. :fcloseall
  615.     int fcloseall()
  616.     - closes all file streams except stdin & stdout
  617.     - returns 0 on success or EOF on error
  618.  
  619. :fcvt
  620.     char *fcvt(value,ndigit,decpt,sign);
  621.     double value; 
  622.     int ndigit; 
  623.     int *decpt,*sign;
  624.     - converts floating point number to a string
  625.     - prototype in: stdlib.h
  626.     - see ecvt().
  627.  
  628. :fdopen
  629.     #include <dos.h>
  630.     FILE *fdopen(handle,type)
  631.     int handle;
  632.     char *type;
  633.     - associates a file STREAM with a file HANDLE
  634.     - 'handle' is returned by creat(), dup(), dup2() or open()
  635.     - 'type' must match mode of the 'handle'
  636.     - see fopen() for 'type' descriptions
  637.     - returns file 'stream' or NULL on error
  638.  
  639. :feof
  640.     #include <stdio.h>
  641.     int feof(FILE *stream);
  642.     - detects end of file on a file stream
  643.     - returns zero if NOT eof, else nonzero
  644.  
  645. :ferror
  646.     #include <stdio.h>
  647.     int ferror(FILE *stream);
  648.     - tests 'stream' for read/write error, returns nonzero if error found
  649.     - error remains set until clearerr() or rewind() is called
  650.  
  651. :fflush
  652.     int fflush(fd)
  653.     FILE *fd;
  654.     - writes contents of output buffers associated with 'fd' to 
  655.       stream and clears input buffer contents; 'fd' is NOT closed
  656.     - returns 0 on success or EOF on error
  657.  
  658. :fgetc
  659.     int fgetc(fd)
  660.     FILE  *fd;
  661.     - function (not a macro) which gets character from stream (needs <stdio.h>)
  662.     - see getc()
  663.     - returns char (converted to an int) or EOF 
  664.  
  665. :fgetchar
  666.     int fgetchar()
  667.     - gets character from stream (needs <stdio.h>)
  668.     - same as fgetc(stdin)
  669.     - see getc()
  670.     - returns char (converted to an int) or EOF 
  671.  
  672. :fgets
  673.     char *fgets(s, size, fd)
  674.     char *s;
  675.     int size;
  676.     FILE *fd;
  677.     - gets a string from a stream, reading until 'size' - 1 characters
  678.       have been read or a newline is detected
  679.     - newline character is retained
  680.     - returns 's' argument if OK, else NULL on eof or error
  681.  
  682. :filelength
  683.     long filelength(handle)
  684.     int handle
  685.     - prototype in: io.h
  686.     - gets file size in bytes for file associated with 'handle'
  687.     - returns -1L on error
  688.  
  689. :fileno
  690.     #include <stdio.h>
  691.     int fileno(FILE *stream)
  692.     - gets file handle for the given 'stream'
  693.     - error return undefined
  694.  
  695. :findfirst
  696.     #include <dir.h>
  697.     #include <dos.h>
  698.     int findfirst(pathname,ffblk,attrib)
  699.     char *pathname;
  700.     struct ffblk *ffblk;
  701.     int  attrib;
  702.     - gets disk directory via DOS 0x4E, where 'attrib' is FA_RDONLY, 
  703.       FA_HIDDEN, FA_SYSTEM, FA_LABEL, FA_DIREC, or FA_ARCH, or a logical
  704.       OR of same.
  705.     - struct ffblk is defined in <dir.h>
  706.     - findfirst sets DTA (use getdta() & setdta() if you need DTA address)
  707.     - returns 0 if OK, else -1 if no matching files found or on error
  708.  
  709. :findnext
  710.     #include <dir.h>
  711.     #include <dos.h>
  712.     int findnext(ffblk)
  713.     struct ffblk *ffblk;
  714.     - gets next disk directory via DOS 0x4F (you call findfirst() first)
  715.     - struct ffblk is defined in <dir.h>
  716.     - findnext sets DTA (use getdta() & setdta() if you need DTA address)
  717.     - returns 0 if OK, else -1 if no matching files found or on error
  718.  
  719. :floor
  720.     double floor(x)
  721.     double x;
  722.  
  723. :flushall
  724.     int flushall()
  725.     - same as fflush() except ALL open file streams are done
  726.     - returns integer indicating number of open file streams
  727.  
  728. :fmod
  729.     double fmod(x,y)
  730.     double x,y;
  731.     - calculates x modulo y, the remainder of x/y, returning the remainder
  732.     - prototype in math.h
  733.  
  734. :fnmerge
  735.     #include <dir.h>
  736.     void fnmerge(path,drive,dir,name,ext)
  737.     char *path, *drive, *dir, *name, *ext;
  738.     - makes a file name ('path') from 'drive', 'dir', 'name', and 'ext'
  739.     - 'dir' can include subdirectories
  740.     - maximum sizes for these strings are:
  741.       MAXPATH  80   'path'
  742.       MAXDRIVE  3   'drive' - includes colon (:)
  743.       MAXDIR   66   'dir' - includes leading/traing backslashes
  744.       MAXFILE   9   'name'
  745.       MAXEXT    5   'ext', including leading dot (.)
  746.     - invertible with fnsplit()
  747.     
  748. :fnsplit
  749.     #include <dir.h>
  750.     void fnsplit(path,drive,dir,name,ext)
  751.     char *path, *drive, *dir, *name, *ext;
  752.     - splits a file name from 'path' into 'drive', 'dir', 'name', and 'ext'
  753.     - 'dir' can include subdirectories
  754.     - maximum sizes for these strings are:
  755.       MAXPATH  80   'path'
  756.       MAXDRIVE  3   'drive' - includes colon (:)
  757.       MAXDIR   66   'dir' - includes leading/traing backslashes
  758.       MAXFILE   9   'name'
  759.       MAXEXT    5   'ext', including leading dot (.)
  760.     - invertible with fnmerge()
  761.     
  762. :fopen
  763.     #include <stdio.h>
  764.     FILE *fopen(filename, type)
  765.     char *filename, *type;
  766.     [NOTES] type = "r" (read), "w" (write), "a" (append),
  767.                    "r+", "w+", "a+", "r+t", "w+t", "a+t",
  768.                    "r+b", "w+t", "a+t", "rt", "wt", "at",
  769.                    "rb", "wb", "ab"
  770.             read == read only (unless "r+")  write == create
  771.             append == seek to end of file or create file
  772.             "+" == allow update access
  773.             "t" == text file      "b" == binary file
  774.             Text file, on reading, will have CRs discarded
  775.      - returns stream or NULL on error
  776.  
  777. :FP_OFF
  778.     #include <dos.h>
  779.     unsigned FP_OFF(void far *farptr);
  780.     - gets offset of far pointer 'farptr', returning unsigned integer value
  781.       
  782. :FP_SEG
  783.     #include <dos.h>
  784.     unsigned FP_SEG(void far *farptr);
  785.     - gets segment of far pointer 'farptr', returning unsigned integer value
  786.  
  787. :_fpreset
  788.     void _fpreset()
  789.     - needs float.h
  790.     - resets floating point math package, usually used with signal(),
  791.       system(), exec..(), spawn..()
  792.     - should be called if using 8087/80287 after using above functions
  793.  
  794. :fprintf
  795.     #include <stdio.h>
  796.     int fprintf(fd, format [, arg1, arg2, ...])
  797.     FILE *fd;
  798.     char *format, arg1, ...;
  799.  
  800. :fputc
  801.     #include <stdio.h>
  802.     int fputc(c, fd)
  803.     int c;
  804.     FILE *fd;
  805.     - puts char 'c' to stream 'fd', returning 'c' on success, else EOF
  806.  
  807. :fputs
  808.     #include <stdio.h>
  809.     int fputs(c, fd)
  810.     char *c;
  811.     FILE *fd;
  812.  
  813. :fread
  814.     #include <stdio.h>
  815.     int fread(buf, size, count, fd)
  816.     void *buf;
  817.     int size, count;
  818.     FILE *fd;
  819.     - reads 'count' of data items, each item being 'size' bytes long,
  820.       from file stream 'fd'
  821.     - returns number of data items (not bytes) actually read
  822.     - returns 0 (or short count) on eof or error
  823.  
  824. :free
  825.     int free(pseg)
  826.     void *pseg;
  827.     - prototypes in stdlib.h, alloc.h
  828.     - frees allocated block
  829.  
  830. :freemem
  831.    int freemem(unsigned seg);
  832.    - prototype in: dos.h
  833.    - frees previously allocated DOS block defined by 'seg'
  834.  
  835. :freopen
  836.     #include <stdio.h>
  837.     FILE *freopen(filename, type, fd)
  838.     char *filename, *type;
  839.     FILE *fd;
  840.     - substitutes named file in place of open 'fd' and closes original 'fd'
  841.     - useful for changing file attached to stdin, stdout, or stderr
  842.     - returns 'fd' on success or NULL on error
  843.     - see fopen() for 'type' descriptions
  844.  
  845. :frexp
  846.     double frexp(value,eptr)
  847.     double value;
  848.     int    *eptr;
  849.     - needs math.h
  850.     - calculates mantissa x (a double < 1) and n (integer) such that
  851.       value = x * 2**n, storing n in word that eptr points to
  852.  
  853. :fscanf
  854.     int fscanf(fd, format, arg1, arg2, ...)
  855.     FILE *fd;
  856.     char *format, arg1, arg2, ...;
  857.     - gets formatted inpu from a stream 'fd'
  858.  
  859. :fseek
  860.     int fseek(fd, offset, mode)
  861.     FILE *fd;
  862.     int mode;
  863.     long offset;
  864.     - prototype in: stdio.h
  865.     - sets file pointer associated with 'fd' to position which is 'offset'
  866.       bytes beyond file location given by 'mode'
  867.     - mode is 0 (beginning of file or SEEK_SET), 1 (current position or
  868.       SEEK_CUR), or 2 (end of file or SEEK_END
  869.     - discards any character pushed back by ungetc()
  870.     - fseek() clears eof indicator but not file error indicator
  871.     - returns 0 if pointer moved OK, else nonzero
  872.  
  873. :fstat
  874.     #include <sys\stat.h>
  875.     int fstat(handle, buff)
  876.     char *handle;
  877.     struct stat *buff
  878.     - see stat()
  879.  
  880. :ftell
  881.     long ftell(FILE *fd)
  882.     - prototype in: stdio.h
  883.     - returns current file position in bytes from beginning of file 
  884.       or -1L on error
  885.     
  886. :fwrite
  887.     #include <stdio.h>
  888.     int fwrite(buf, size, count, fd)
  889.     void *buf;
  890.     int size, count;
  891.     FILE *fd;
  892.     - writes 'count' of data items, each item being 'size' bytes long,
  893.       to file stream 'fd'
  894.     - returns number of data items (not bytes) actually written
  895.     - returns short count on error
  896.  
  897. :gcvt
  898.    char *gcvt(double value, int ndigit, char *buf)
  899.    - needs stdlib.h
  900.    - converts a floating pt number to a string of 'ndigit' digits,
  901.      storing string into 'buf' and returning pointer to that string
  902.    - output is in Fortran-F format if possible, else in Fortran-E format
  903.  
  904. :geninterrupt
  905.    #include <dos.h>
  906.    void geninterrupt(int intr_num)
  907.    - traps interrupts of 'intr_num'
  908.    - see getvect()
  909.  
  910. :getc
  911.     #include <stdio.h>
  912.     int getc(fd)
  913.     FILE *fd;
  914.     - macro which returns next character in file stream 'fd' or EOF on 
  915.       end of file or error
  916.  
  917. :getcbrk
  918.     int getcbrk()
  919.     - prototype in: dos.h
  920.     - gets control-break setting (0 if cntl-C is off; else 1)
  921.  
  922. :getch
  923.     #include <stdio.h>
  924.     int getch()
  925.     - function which returns next character from console without echoing
  926.  
  927. :getchar
  928.     #include <stdio.h>
  929.     int getchar()
  930.     - macro which returns next character in file stream 'stdin' or EOF on 
  931.       end of file or error
  932.  
  933. :getche
  934.     #include <stdio.h>
  935.     int getche()
  936.     - function which returns next character from console WITH echoing
  937.  
  938. :getcurdir
  939.     int getcurdir(int drive, char *direc);
  940.     - get current directory for specified 'drive' (0=default, 1=A, etc)
  941.     - 'direc' will return directory name
  942.     - returns 0 if OK, else -1 on error
  943.     - needs dir.h.
  944.  
  945. :getcwd
  946.     char *getcwd(char *buf,int n);
  947.     - gets full path name of current working directory up to 'n' bytes,
  948.       placed into 'buf'
  949.     - returns 'buf' pointer, else NULL
  950.     - needs dir.h
  951.  
  952. :getdate
  953.     #include <dos.h>
  954.     void getdate(struct date *dateblk);
  955.     - gets MS-DOS date, filling it into 'dateblk'
  956.  
  957. :getdfree
  958.     #include <dos.h>
  959.     void getdfree(int drive, struct dfree *dfreep);
  960.     - filles in 'dfreep' structure with disk characters
  961.       struct dfree {
  962.          unsigned df_avail;  /* available clusters */
  963.          unsigned df_total;  /* total clusters */
  964.          unsigned df_bsec;   /* bytes per sector */
  965.          unsigned df_sclus;  /* sectors per cluster */
  966.          };
  967.      - in event of error, 'df_sclus' is set to -1.
  968.  
  969. :getdisk
  970.     int getdisk()
  971.     - needs dir.h
  972.     - returns integer = 0 (for A), 1 (for B), etc
  973.  
  974. :getdta
  975.     char far *getdta()
  976.     - prototype in: dos.h
  977.     - returns current setting of the DTA as a far pointer
  978.  
  979. :getenv
  980.     char *getenv(char *envvar);
  981.     - gets string from environment
  982.     - MSDOS environment consists of strings of form 'envvar=varvalue,...'
  983.     - returns 'varvalue' or 0 if 'envvar' not found in environment
  984.  
  985. :getfat
  986.     #include <dos.h>
  987.     void getfat(int drive,struct fatinfo *fatblkp);
  988.     - returns information from the file allocation table for the specified
  989.       'drive' (0=default,1=A, etc) into 'fatblk'
  990.     - structure 'fatinfo' is defined in dos.h
  991.  
  992. :getfatd
  993.     #include <dos.h>
  994.     void getfatd(struct fatinfo *fatblkp);
  995.     - returns information from the file allocation table for the DEFAULT 
  996.       drive into 'fatblk'
  997.     - structure 'fatinfo' is defined in dos.h
  998.  
  999. :getftime
  1000.     #include <dos.h>
  1001.     int getftime(int handle,struct ftime *ftimep);
  1002.     - retrieves file time and date for the file associated with 'handle'
  1003.       into 'ftimep'
  1004.     - structure ftime is defined in dos.h
  1005.  
  1006. :getpass
  1007.     char *getpass(char *prompt);
  1008.     - prototype in: conio.h
  1009.     - reads a password from system console after typing 'prompt', without
  1010.       echoing
  1011.     - password cannot exceed 8 characters (not counting null terminator)
  1012.  
  1013. :getpsp
  1014.     unsigned getpsp()
  1015.     - prototype in: dos.h
  1016.     - returns segment address of the PSP using DOS call 0x62
  1017.     - valid only for DOS 3.x
  1018.     - use global variable '_psp' to get PSP instead for DOS 2.X
  1019.  
  1020. :gets
  1021.     char *gets(s)
  1022.     char *s;
  1023.     - reads string from 'stdin' until newline character is read
  1024.     - newline character is replaced by '\0'
  1025.     - returns string or NULL on end-of-file or error
  1026.  
  1027. :gettime
  1028.     #include <dos.h>
  1029.     void gettime(struct time *timep);
  1030.     - gets MS-DOS time
  1031.  
  1032. :getvect
  1033.     void interrupt(*getvect(int intr_num))();
  1034.     - prototype in dos.h
  1035.     - reads the value of interrupt vector named by 'intr_num' 
  1036.       (corresponds to 0-255 for MS-DOS)
  1037.     - returns 4-byte value stored in MS-DOS interrupt table (far
  1038.       pointer)
  1039.  
  1040. :getverify
  1041.     int getverify()
  1042.     - returns current state of verify flag (0==off, 1==on)
  1043.     - prototype in dos.h
  1044.  
  1045. :getw
  1046.     #include <stdio.h>
  1047.     int getw(fd)
  1048.     FILE *fd;
  1049.     - gets integer from file stream 'fd'
  1050.     - returns EOF (-1) on eof or error
  1051.     - use feof() or ferror() to verify -1 is integer, not error return
  1052.  
  1053. :gmtime
  1054.    struct tm *gmtime(long *clock)
  1055.    - 'clock' is a long integer (such as that returned by time())
  1056.    - returns GMT time in struct tm (see time.h) correcting for time
  1057.      zone and any daylight savings time
  1058.    - global variable 'timezone' is difference in seconds between GMT
  1059.      and local standard time
  1060.    - needs time.h
  1061.  
  1062. :gsignal
  1063.     int gsignal(int sig);
  1064.     int (*ssignal(int sig, int (*action)())();
  1065.     - prototype in: signal.h
  1066.     - ssignal() and gsignal() implement a software-signaling facility where
  1067.       software signals are integers 1-15
  1068.     - gsignal() raises the signal given by 'sig' and executes the action
  1069.       routine
  1070.     - ssignal() establishes an action routine for servicing a signal where
  1071.       'sig' is associated with the 'action' routine
  1072.     - ssignal() returns action previously established for ssignal() or SIG_DFL
  1073.     - gsignal() returns value by action or SIG_IGN or SIG_DFL
  1074.     - UNIX based
  1075.  
  1076. :harderr
  1077.     void harderr(int(*fptr)());
  1078.     void hardresume(int rescode);
  1079.     void hardretn(int errcode);
  1080.     - prototype in: dos.h
  1081.     - harderr() establishes a hardware error handler for current program,
  1082.       invoked wherever interrupt 0x24 occurs
  1083.     - function via 'fptr' is called when such an interrupt occurs
  1084.     - handler function will be called with the follwing arguments=
  1085.          handler(int errval, int ax, int bp, int si);
  1086.       where 'errval' is error code in DI register by MS-DOS, and 'ax', 'bp',
  1087.       'si" are values MS-DOS has in AX, BP, and SI registers
  1088.     - 'ax' indicates if disk or other device error occurs - if 'ax' is not
  1089.       negative, then disk error, else device error.  For disk error, 'ax' ANDed
  1090.       with 0x00ff will give bad drive number
  1091.     - 'bp' and 'si' together point to device driver header
  1092.     - hardresume() may be called with 'rescode' to return to MS-DOS, where
  1093.       'rescode' = 2 (for abort), 1 (retry) or 0 (ignore)
  1094.     - hardrtn() may be called to return directly to the application program
  1095.     - handler must return 0 for ignore, 1 for retry, or 2 for abort
  1096.     - handler may issue bdos calls 1 through 0xC, but no others, and no C 
  1097.       standard I/O or UNIX I/O calls may be used
  1098.  
  1099. :hardresume
  1100.     void harderr(int(*fptr)());
  1101.     void hardresume(int rescode);
  1102.     void hardretn(int errcode);
  1103.     - prototype in: dos.h
  1104.     - harderr() establishes a hardware error handler for current program,
  1105.       invoked wherever interrupt 0x24 occurs
  1106.     - function via 'fptr' is called when such an interrupt occurs
  1107.     - handler function will be called with the follwing arguments=
  1108.          handler(int errval, int ax, int bp, int si);
  1109.       where 'errval' is error code in DI register by MS-DOS, and 'ax', 'bp',
  1110.       'si" are values MS-DOS has in AX, BP, and SI registers
  1111.     - 'ax' indicates if disk or other device error occurs - if 'ax' is not
  1112.       negative, then disk error, else device error.  For disk error, 'ax' ANDed
  1113.       with 0x00ff will give bad drive number
  1114.     - 'bp' and 'si' together point to device driver header
  1115.     - hardresume() may be called with 'rescode' to return to MS-DOS, where
  1116.       'rescode' = 2 (for abort), 1 (retry) or 0 (ignore)
  1117.     - hardrtn() may be called to return directly to the application program
  1118.     - handler must return 0 for ignore, 1 for retry, or 2 for abort
  1119.     - handler may issue bdos calls 1 through 0xC, but no others, and no C 
  1120.       standard I/O or UNIX I/O calls may be used
  1121.  
  1122. :hardrtn
  1123.     void harderr(int(*fptr)());
  1124.     void hardresume(int rescode);
  1125.     void hardretn(int errcode);
  1126.     - prototype in: dos.h
  1127.     - harderr() establishes a hardware error handler for current program,
  1128.       invoked wherever interrupt 0x24 occurs
  1129.     - function via 'fptr' is called when such an interrupt occurs
  1130.     - handler function will be called with the follwing arguments=
  1131.          handler(int errval, int ax, int bp, int si);
  1132.       where 'errval' is error code in DI register by MS-DOS, and 'ax', 'bp',
  1133.       'si" are values MS-DOS has in AX, BP, and SI registers
  1134.     - 'ax' indicates if disk or other device error occurs - if 'ax' is not
  1135.       negative, then disk error, else device error.  For disk error, 'ax' ANDed
  1136.       with 0x00ff will give bad drive number
  1137.     - 'bp' and 'si' together point to device driver header
  1138.     - hardresume() may be called with 'rescode' to return to MS-DOS, where
  1139.       'rescode' = 2 (for abort), 1 (retry) or 0 (ignore)
  1140.     - hardrtn() may be called to return directly to the application program
  1141.     - handler must return 0 for ignore, 1 for retry, or 2 for abort
  1142.     - handler may issue bdos calls 1 through 0xC, but no others, and no C 
  1143.       standard I/O or UNIX I/O calls may be used
  1144.  
  1145. :hypot
  1146.     double hypot(double x,double y)
  1147.     - prototype in math.h
  1148.     - returns z where z**2 = x**2 + y**2, or HUGE_VAL on error
  1149.  
  1150. :inport
  1151.     #include <dos.h>
  1152.     int inport(int port);
  1153.     int inportb(int port);
  1154.     void outport(int port, int word);
  1155.     void outportb(int port, char byte);
  1156.     - inport() reads word from input port 'port'
  1157.     - inportb() is macro that reads byte from input port 'port'
  1158.     - outport() writes 'word' to output port 'port'
  1159.     - outportb() is macro that writes 'byte' to output port 'port'
  1160.  
  1161. :inportb
  1162.     #include <dos.h>
  1163.     int inport(int port);
  1164.     int inportb(int port);
  1165.     void outport(int port, int word);
  1166.     void outportb(int port, char byte);
  1167.     - inport() reads word from input port 'port'
  1168.     - inportb() is macro that reads byte from input port 'port'
  1169.     - outport() writes 'word' to output port 'port'
  1170.     - outportb() is macro that writes 'byte' to output port 'port'
  1171.  
  1172. :int86
  1173.     #include <dos.h>
  1174.     int int86(int intr_num,union REGS *inregs, union REGS *outregs);
  1175.     int int86x(int intr_num,union REGS *inregs, union REGS *outregs,
  1176.                struct SREGS *segregs);
  1177.     - Executes 8086 software interrupt specified by 'intr_num"
  1178.     - Copies register values fron 'inregs' into the registers
  1179.     - int86x() also copies segregs->x.ds and segregs->y.es into DS/ES
  1180.     - if carry flag is set, an error has occurred
  1181.  
  1182. :int86x
  1183.     #include <dos.h>
  1184.     int int86(int intr_num,union REGS *inregs, union REGS *outregs);
  1185.     int int86x(int intr_num,union REGS *inregs, union REGS *outregs,
  1186.                struct SREGS *segregs);
  1187.     - Executes 8086 software interrupt specified by 'intr_num"
  1188.     - Copies register values fron 'inregs' into the registers
  1189.     - int86x() also copies segregs->x.ds and segregs->y.es into DS/ES
  1190.     - if carry flag is set, an error has occurred
  1191.  
  1192. :intdos
  1193.     #include <dos.h>
  1194.     int intdos(union REGS *inregs, union REGS *outregs);
  1195.     int intdosx(union REGS *inregs, union REGS *outregs,
  1196.                struct SREGS *segregs);
  1197.     - Executes 8086 software interrupt 0x21
  1198.     - Copies register values fron 'inregs' into the registers
  1199.     - int86x() also copies segregs->x.ds and segregs->y.es into DS/ES
  1200.     - if carry flag is set, an error has occurred
  1201.  
  1202. :intdosx
  1203.     #include <dos.h>
  1204.     int intdos(union REGS *inregs, union REGS *outregs);
  1205.     int intdosx(union REGS *inregs, union REGS *outregs,
  1206.                struct SREGS *segregs);
  1207.     - Executes 8086 software interrupt 0x21
  1208.     - Copies register values fron 'inregs' into the registers
  1209.     - int86x() also copies segregs->x.ds and segregs->y.es into DS/ES
  1210.     - if carry flag is set, an error has occurred
  1211.  
  1212. :intr
  1213.     #include <dos.h>
  1214.     void intr(int intr_num,struct REGPACK *preg);
  1215.     - same as int86 except that 'preg' contains registers values both 
  1216.       before & after executing interrupt
  1217.  
  1218. :ioctl
  1219.     int ioctl(int handle,int cmd[,int *argdx,int argcx]);
  1220.     - prototype in io.h
  1221.     - direct interface to MS-DOS call 0x44 (IOCTL)
  1222.     - 'cmd' is: 0 - get device information
  1223.                 1 - set device information (in 'argdx')
  1224.                 2 - read 'argcx' bytes into addr given by 'argdx'
  1225.                 3 - write 'argcx' bytes from addr given by 'argdx'
  1226.                 4 - same as 2, except 'handle' treated as drive (0=default,
  1227.                     1=A, etc)
  1228.                 5 - same as 3, except 'handle' treated as drive (0=default,
  1229.                     1=A, etc)
  1230.                 6 - get input status
  1231.                 7 - get output status
  1232.                 8 - test removability (DOS 3.x)
  1233.                 11- set sharing conflict retry count (DOS 3.x)
  1234.     - 'cmd'=0,1; returns device information (DX of IOCTL call)
  1235.     - 'cmd'=2-5; returns count of bytes transferred
  1236.     - 'cmd'=6,7; returns device status
  1237.     - returns -1 on error & 'errno' = EINVAL, EBADF, or EINVDAT
  1238.  
  1239. :is...
  1240.     - prototype in: io.h
  1241.     - 'c' below are int type
  1242.     int isalnum(c)  - nonzero if letter or digit
  1243.     int isalpha(c)  - nonzero if letter
  1244.     int isascii(c)  - nonzero if in range 0-127
  1245.     int iscntrl(c)  - nonzero if 0x7F, or 0x00-0x1F
  1246.     int isdigit(c)  - nonzero if digit
  1247.     int isgraph(c)  - nonzero if printable (0x21-0x7E) except space excluded
  1248.     int islower(c)  - nonzero if lowercase
  1249.     int isprint(c)  - nonzero if printable (0x20-0x7E)
  1250.     int ispunct(c)  - nonzero if punctuation char (iscntrl or isspace)
  1251.     int isspace(c)  - nonzero if space,tab, CR, LF, VT or FF
  1252.     int isupper(c)  - nonzero if uppercase
  1253.     int isxdigit(c) - nonzero if hexadecimal digit
  1254.  
  1255. :isatty
  1256.     int isatty(int handle)
  1257.     - prototype in: io.h
  1258.     - if 'handle' associated with character device (tty,console,printer,
  1259.       or serial port) returns nonzero integer; else returns 0
  1260.  
  1261. :itoa
  1262.     char *itoa(int value,char *string,int radix);
  1263.     - converts 'value' to 'string' where 'radix' specifies base (2-36) for
  1264.       conversion
  1265.  
  1266. :kbhit
  1267.     int kbhit()
  1268.     - prototype in: conio.h
  1269.     - returns nonzero if keystroke available else 0
  1270.  
  1271. :keep
  1272.     void keep(int status, int size);
  1273.     - prototype in: dos.h
  1274.     - keep() returns to MS-DOS with exit status in 'status', retaining
  1275.       current program resident in memory with 'size' paragraphs and rest
  1276.       of memory freed
  1277.     - uses DOS function 0x31
  1278.  
  1279. :labs
  1280.     long labs(long n);
  1281.     - prototype in: stdlib.h
  1282.     - returns absolute long value of 'n'
  1283.  
  1284. :ldexp
  1285.     double ldexp(double value,int exp);
  1286.     - prototype in: math.h
  1287.     - returns 'value' x 2**'exp'
  1288.  
  1289. :lfind
  1290.    void *lfind(key,base,nelem,width,fcmp)
  1291.    void *key, void *base, int *nelem, int width, int (*fcmp)();
  1292.    - does linear search for items in a table; table does not need to be
  1293.      sorted
  1294.    - 'base' points to 0th element of table
  1295.    - 'nelem' points to integer containing number of entries in table
  1296.    - 'width' contains number of bytes in each entry
  1297.    - 'key' points to the search key
  1298.    - 'fcmp' points to user-written comparison routine, where 'key' and
  1299.      'elem' are passed to it as pointers.  'fcmp' returns integer != 0
  1300.      if search key != *elem; integer = 0 if identical 
  1301.    - returns 0 if no match found, else address of first entry that matches
  1302.    - needs stdlib.h
  1303.  
  1304. :localtime
  1305.    struct tm *localtime(long *clock)
  1306.    - 'clock' is a long integer (such as that returned by time())
  1307.    - returns time in struct tm (see time.h) correcting for time
  1308.      zone and any daylight savings time
  1309.    - global variable 'timezone' is difference in seconds between GMT
  1310.      and local standard time
  1311.    - needs time.h
  1312.  
  1313. :lock
  1314.     int lock(int handle, long offset, long length);
  1315.     int unlock(int handle, long offset, long length);
  1316.     - lock() locks arbitrary, non-overlapping regions of any file (DOS 3.X), 
  1317.       preventing reads/writes to those regions
  1318.     - unlock() removes said locks
  1319.     - returns 0 on success, else -1 on error
  1320.  
  1321. :log
  1322.     double log(x)
  1323.     double x;
  1324.     - needs math.h
  1325.     - returns natural logarithm of 'x', or -HUGE_VAL on error
  1326.  
  1327. :log10
  1328.     double log10(x)
  1329.     double x;
  1330.     - needs math.h
  1331.     - returns base 10 logarithm of 'x', or -HUGE_VAL on error
  1332.  
  1333. :longjmp
  1334.     #include <setjmp.h>
  1335.     void longjmp(jmp_buf env, int id);
  1336.     - call to longjmp() with 'env' restores task state (set by
  1337.       setjmp()), returning value 'id'
  1338.     - cannot return 0; if 'id' == 0, returns 1
  1339.  
  1340. :lsearch
  1341.    void *lsearch(key,base,nelem,width,fcmp)
  1342.    void *key, void *base, int *nelem, int width, int (*fcmp)();
  1343.    - does linear search for items in a table; table does not need to be
  1344.      sorted
  1345.    - 'base' points to 0th element of table
  1346.    - 'nelem' points to integer containing number of entries in table
  1347.    - 'width' contains number of bytes in each entry
  1348.    - 'key' points to the search key
  1349.    - 'fcmp' points to user-written comparison routine, where 'key' and
  1350.      'elem' are passed to it as pointers.  'fcmp' returns integer != 0
  1351.      if search key != *elem; integer = 0 if identical 
  1352.    - returns 0 if no match found, else address of first entry that matches
  1353.    - needs stdlib.h
  1354.  
  1355. :lseek
  1356.     long lseek(fd, offset, mode)
  1357.     int fd, mode;
  1358.     long offset;
  1359.     - sets file associated with 'fd' to 'offset' from beginning of file 
  1360.       ('mode' = 0 or SEEK_SET), current position ('mode' = 1 or SEEK_CUR),
  1361.       or end of file ('mode' = 2 or SEEK_END)
  1362.     - returns -1L on error
  1363.  
  1364. :ltoa
  1365.     char *ltoa(long value,char *string,int radix);
  1366.     - converts 'value' to 'string' where 'radix' specifies base (2-36) for
  1367.       conversion
  1368.  
  1369. :malloc
  1370.     void *malloc(size)
  1371.     unsigned size;
  1372.     - prototype in stdlib.h, alloc.h
  1373.     - allocates memory of length 'size' in bytes
  1374.     - returns pointer if successful, else NULL
  1375.  
  1376. :_matherr
  1377.     #include <math.h>
  1378.     double _matherr(_mexcep why, char *fun, double *arg1p,
  1379.                     double *arg2p, double retval);
  1380.     - used with matherr(), calling matherr() and processes the return value
  1381.       from matherr()
  1382.     - floating point error handling routine
  1383.  
  1384. :matherr
  1385.     #include <math.h>
  1386.     int matherr(struct exception *e);
  1387.     - provided as customizable math error-handling routine
  1388.  
  1389. :mem...
  1390.     void *memccpy(void *destin,void *source,unsigned char ch,unsigned n);
  1391.     void *memchr(void *s,char ch,unsigned n);
  1392.     void *memcmp(void *s1,void *s2,unsigned n);
  1393.     int  memicmp(void *s1,void *s2,unsigned n);
  1394.     void *memmove(void *destin,void *source,unsigned n);
  1395.     void *memcpy(void *destin,void *source,unsigned n);
  1396.     void *memset(void *s,char ch,unsigned n);
  1397.     - prototype in: string.h, mem.h
  1398.     - memcpy copies 'n' bytes from 'source' to 'destin'; returns 'destin'
  1399.     - memmove - same as memcpy
  1400.     - memset sets all bytes of 's' to byte 'ch', with size of 's' = 'n';
  1401.       returns value of 's'
  1402.     - memcmp compares two strings 's1' & 's2' for length of 'n' bytes,
  1403.       returning a value < 0 is 's1' < 's2', = 0 if 's1'='s2', and > 0 if
  1404.       's1' > 's2', where compares is for unsigned chars.
  1405.     - memicmp compares first 'n' bytes of 's1' & 's2', case insensitive
  1406.     - memccpy copies from 'source' to 'destin' until 'ch' is copied or
  1407.       'n' bytes have been done, returning pointer to byte in 'destin'
  1408.       immediately following 'ch' or NULL
  1409.     - memchr searches first 'n' bytes in 's' for 'ch', returning pointer
  1410.       to first occurrence or NULL if not found
  1411.  
  1412. :MK_FP
  1413.     #include <dos.h>
  1414.     void far *MK_FP(unsigned seg,unsigned off);
  1415.     - returns a far pointer from offset 'off' and segment 'seg'      
  1416.  
  1417. :mkdir
  1418.     int mkdir(char *pathname);
  1419.     - prototype in dir.h
  1420.     - takes 'pathname' & creates new directory with that name 
  1421.     - returns 0 if successful, else -1
  1422.  
  1423. :mktemp
  1424.     char *mktemp(char *template);
  1425.     - prototype in dir.h
  1426.     - replaces 'template' by unique file name & returns addr of 'template'
  1427.       if successful
  1428.     - 'template' should be null-terminated string with six trailing X's
  1429.  
  1430. :modf
  1431.     double modf(value,iptr)
  1432.     double value, *iptr;
  1433.     - splits 'value' in integer and fraction part, storing integer part
  1434.       in area pointed to by 'iptr', returning the fractional part
  1435.  
  1436. :movedata
  1437.     void movedate(int segsrc,int offsrc,int segdest,int offdest,unsigned n);
  1438.     - prototype in mem.h, string.h
  1439.     - copies 'n' bytes from segsrc:offsrc to segdest:offdest
  1440.  
  1441. :movmem
  1442.     void movmem(void *source,void *destin,unsigned len);
  1443.     - prototype in mem.h
  1444.     - copies 'len' bytes from 'source' to 'destin'
  1445.  
  1446. :_open
  1447.     #include <fcntl.h>
  1448.     int _open(char *pathname,int access);
  1449.     - prototype in io.h
  1450.     - see open()
  1451.  
  1452. :open
  1453.     #include <fcntl.h>
  1454.     int open(filename, access[,permis])
  1455.     char *filename;
  1456.     int access,permis;
  1457.     - prototype in io.h
  1458.     - opens file 'pathname' with 'access' and optionally 'permis'
  1459.     - 'access' is O_RDONLY, O_WRONLY, or O_RDWR, with O_APPEND, O_CREAT,
  1460.       O_TRUNC (if file exists, truncate length to zero, but leave file
  1461.       attributes unchanged), O_BINARY (binary mode), or O_TEXT (text mode).
  1462.     - Additional not used (UNIX only): O_NDELAY, O_EXCL
  1463.     - if O_BINARY nor O_TEXT is given, file is opened in translation mode
  1464.       given by global variable _fmode
  1465.     - if O_CREAT is used, 'permis' can be set to S_IWRITE, S_IREAD, or
  1466.       S_IREAD|S_IWRITE
  1467.     - Additional 'access' values for DOS 3.x
  1468.     - fcntl.h and stat.h contain values for these
  1469.     - returns nonnegative number as file HANDLE, or -1 on error
  1470.  
  1471. :outport
  1472.     #include <dos.h>
  1473.     int inport(int port);
  1474.     int inportb(int port);
  1475.     void outport(int port, int word);
  1476.     void outportb(int port, char byte);
  1477.     - inport() reads word from input port 'port'
  1478.     - inportb() is macro that reads byte from input port 'port'
  1479.     - outport() writes 'word' to output port 'port'
  1480.     - outportb() is macro that writes 'byte' to output port 'port'
  1481.  
  1482. :outportb
  1483.     #include <dos.h>
  1484.     int inport(int port);
  1485.     int inportb(int port);
  1486.     void outport(int port, int word);
  1487.     void outportb(int port, char byte);
  1488.     - inport() reads word from input port 'port'
  1489.     - inportb() is macro that reads byte from input port 'port'
  1490.     - outport() writes 'word' to output port 'port'
  1491.     - outportb() is macro that writes 'byte' to output port 'port'
  1492.  
  1493. :parsfnm
  1494.     #include <dos.h>
  1495.     char *parsfnm(char *cmdline,struct fcb *fcbptr, int option);
  1496.     - parses command line 'cmdline' for a file name, placing it into a
  1497.       FCB as drive/filename/file ext, pointed to by 'fcbptr'
  1498.     - 'option' is same as documented for AL in MS-DOS function call 0x29
  1499.     - returns pointer to byte beyond end of filename, or 0 on error
  1500.  
  1501. :peek
  1502.     int peek(int seg,unsigned off);
  1503.     - prototype in dos.h
  1504.     - returns word found at seg:off
  1505.  
  1506. :peekb
  1507.     int peekb(int seg,unsigned off);
  1508.     - prototype in dos.h
  1509.     - returns byte found at seg:off
  1510.  
  1511. :perror
  1512.     void perror(char *string);
  1513.     - prototype in stdio.h
  1514.     - prints error message to stderr, describing most recent call found
  1515.       in system call from current program 
  1516.  
  1517. :poke
  1518.     void poke(int seg,int off,int value);
  1519.     - prototype in dos.h
  1520.     - writes word 'value' to location seg:off
  1521.  
  1522. :pokeb
  1523.     void pokeb(int seg,int off,char value);
  1524.     - prototype in dos.h
  1525.     - writes byte 'value' to location seg:off
  1526.  
  1527. :poly
  1528.     double poly(double x,int n,double coeff[]);
  1529.     - prototype in math.h
  1530.     - generates polynominal in 'x' of degree 'n', with coefficients 'coeff',
  1531.       returning the value of this polynominal evaluated for 'x'
  1532.  
  1533. :pow
  1534.     double pow(x,y)
  1535.     double x,y;
  1536.     - needs math.h
  1537.     - returns p where p = x ** y or +/- HUGE_VAL on error
  1538.  
  1539. :pow10
  1540.     double pow10(x)
  1541.     double x;
  1542.     - need math.h
  1543.     - returns y where y = 10 ** x or HUGE_VAL on overflow error
  1544.  
  1545. :printf
  1546.     void printf(format [, arg1, arg2, ...])
  1547.     char *format;
  1548.  
  1549. :putc
  1550.     int putc(c, fd)
  1551.     int c;
  1552.     FILE *fd;
  1553.     - puts char 'c' to stream 'fd', returning 'c' on success, else
  1554.       returns EOF on error
  1555.  
  1556. :putch
  1557.     int putch(ch)
  1558.     int ch;
  1559.     - puts char 'ch' to console; putch returns nothing
  1560.  
  1561. :putchar
  1562.     putchar(c)
  1563.     char c;
  1564.     - same as putc(c,stdout)
  1565.  
  1566. :putenv
  1567.     int putenv(char *envvar);
  1568.     - adds string to environment
  1569.     - MSDOS environment consists of strings of form 'envvar=varvalue,...'
  1570.     - returns 0 if OK, or -1 on failure (such as not enough environment space)
  1571.  
  1572. :puts
  1573.     void puts(string)
  1574.     char *string;
  1575.  
  1576. :putw
  1577.     int putw(n, fd)
  1578.     int n;
  1579.     FILE *fd;
  1580.     - puts integer word 'n' to stream 'fd'
  1581.     - returns 'n' or EOF on error.  Use ferror() to verify if EOF is
  1582.       returned, since -1 is a legitimate integer.
  1583.  
  1584. :qsort
  1585.     void qsort(array, elementCount, elementSize, compareFunc)
  1586.     char *array;
  1587.     int elementCount, elementSize, (*compareFunc)();
  1588.     - 'compareFunc' is same as for bsearch()
  1589.  
  1590. :rand
  1591.     int rand()
  1592.     void srand(unsigned seed);
  1593.     - prototype in stdlib.h
  1594.     - rand() returns pseudorandom numbers
  1595.     - reinitialize with srand(1) or set to new starting point with
  1596.       'seed' set other than to 1
  1597.  
  1598. :randbrd
  1599.     #include <dos.h>
  1600.     int randbrd(struct fcb *fcbptr,int reccnt);
  1601.     int randbrw(struct fcb *fcbptr,int reccnt);
  1602.     - randbrd() reads 'reccnt' number of records using the open
  1603.       FCB via 'fcbptr', as indicated by the disk record field of
  1604.       the FCB (via DOS call 0x27).
  1605.     - returns:
  1606.       0 == all records read(written)
  1607.       1 == EOF reached & last record read is complete
  1608.       2 == reading records would have wrapped around address 0xffff
  1609.       3 == EOF reached & last record is incomplete
  1610.     - randbrw() returns 1 if there is not enough disk space to
  1611.       write the records (no records are written)
  1612.  
  1613. :randbrw
  1614.     #include <dos.h>
  1615.     int randbrw(struct fcb *fcbptr,int reccnt);
  1616.     - see randbrd()
  1617.  
  1618. :_read
  1619.     int _read(int fd, void *buf, int size);
  1620.     - see read()
  1621.  
  1622. :read
  1623.     int read(fd, buf, size)
  1624.     int fd, size;
  1625.     char *buf;
  1626.     - prototype in io.h
  1627.     - reads 'size' bytes from file handle 'fd' into 'buf'
  1628.     - _read() is direct call to MS-DOS read system all
  1629.     - read() removes CRs & reports EOF on a CNTL-Z for file
  1630.       opened in text mode.  _read() does not.
  1631.     - returns actual number of bytes read, 0 on EOF, or -1 on
  1632.       error
  1633.  
  1634. :realloc
  1635.     void *realloc(pseg, size)
  1636.     void *pseg;
  1637.     unsigned size;
  1638.     - prototype in stdlib.h & alloc.h
  1639.     - see malloc()
  1640.  
  1641. :rename
  1642.     int rename(oldf, newf)
  1643.     char *oldf, *newf;
  1644.     - returns 0 if OK, else -1 on error
  1645.  
  1646. :rewind
  1647.     int rewind(FILE *fd)
  1648.     - prototype in: stdio.h
  1649.     - equivalent to fseek(fd,0L,0), except eof and error indicators 
  1650.       are cleared
  1651.     - returns 0 if pointer moved OK, else nonzero
  1652.     
  1653. :rmdir
  1654.     int rmdir(char *pathname);
  1655.     - prototype in dir.h
  1656.     - takes 'pathname' & deletes directory with that name 
  1657.     - returns 0 if successful, else -1
  1658.  
  1659. :sbrk
  1660.     int sbrk(incr)
  1661.     int incr;
  1662.     - dynamically changes the amount of space allocated to the calling
  1663.       program's data segment.  Amount of allocated space is increased
  1664.       by amount 'incr' (can be negative).
  1665.     - returns 0 if OK; else -1 & 'errno' is set to ENOMEM
  1666.  
  1667. :scanf
  1668.     int scanf(format, arg1, arg2, ...)
  1669.     char *format;
  1670.     - accepts input from stdin
  1671.  
  1672. :searchpath
  1673.     char *searchpath(char *filename)
  1674.     - prototype in dir.h
  1675.     - attempts to locate 'filename' using MS-DOS path
  1676.     - returns pointer to full pathname for 'filename' (in a static
  1677.       array) or NULL if not found
  1678.  
  1679. :segread
  1680.     void segread(struct SREGS *segtbl);
  1681.     - prototype in dos.h
  1682.     - places current values of segment registers (SEGREGS) into
  1683.       'segtbl'
  1684.  
  1685. :setblock
  1686.     int setblock(int seg,int newsize);
  1687.     - prototype in dos.h
  1688.     - modifies size of previously allocated DOS memory segment
  1689.  
  1690. :setbuf
  1691.     #include <stdio.h>
  1692.     void setbuf(FILE *stream,char *buf);
  1693.     int setvbuf(FILE *stream,char *buf,int type,unsigned size);
  1694.     - causes 'buf' to be used for I/O bufferring instead of
  1695.       automatically allocated buffer, and are used after given
  1696.       'stream' is opened
  1697.     - in setbuf, if 'buf' is NULL, I/O is unbuffered
  1698.     - in setvbuf, if 'buf' is NULL, a buffer is allocated via
  1699.       malloc()
  1700.  
  1701. :setcbrk
  1702.     int setcbrk(value)
  1703.     int value;
  1704.     - prototype in: dos.h
  1705.     - sets control-break setting (0 to set cntl-C off; else 1)
  1706.    
  1707. :setdate
  1708.     #include <dos.h>
  1709.     void setdate(struct date *dateblk);
  1710.     - sets MS-DOS date
  1711.  
  1712. :setdisk
  1713.     int setdisk(int drive)
  1714.     - needs dir.h
  1715.     - set current drive to 'drive' (0 for A, 1 for B, etc)
  1716.     - returns total number of drives available
  1717.  
  1718. :setdta
  1719.     void setdta(char far *dta)
  1720.     - prototype in: dos.h
  1721.     - changes current setting of the DTA as given by 'dta'
  1722.  
  1723. :setftime
  1724.     #include <dos.h>
  1725.     int setftime(int handle,struct ftime *ftimep);
  1726.     - sets file time and date for the file associated with 'handle' as
  1727.       defined by 'ftimep'
  1728.     - structure ftime is defined in dos.h
  1729.  
  1730. :setjmp
  1731.     #include <setjmp.h>
  1732.     int setjmp(jmp_buf env);
  1733.     - captures caller's task state in 'env' and returns 0
  1734.     - see longjmp()
  1735.  
  1736. :setmem
  1737.     void setmem(void *addr,int len,char value);
  1738.     - prototype in mem.h
  1739.     - sets 'len' bytes in 'addr' to 'value'
  1740.  
  1741. :setmode
  1742.     int setmode(int handle,unsigned mode);
  1743.     - prototype in io.h
  1744.     - sets 'mode' of file associated with 'handle' to binary
  1745.      (O_BINARY) or text (O_TEXT) but not both
  1746.     - returns 0 if successful, else -1 on error
  1747.  
  1748. :settime
  1749.     #include <dos.h>
  1750.     void settime(struct time *timep);
  1751.     - sets MS-DOS time
  1752.  
  1753. :setvbuf
  1754.     #include <stdio.h>
  1755.     int setvbuf(FILE *stream,char *buf,int type,unsigned size);
  1756.     - see sebuf()
  1757.  
  1758. :setvect
  1759.     void setvect(int intr_num),void interupt(*isr)());
  1760.     - prototype in dos.h
  1761.     - sets the value of interrupt vector named by 'intr_num' 
  1762.       (corresponds to 0-255 for MS-DOS) in MS-DOS interrupt table (far
  1763.       pointer) to far pointer 'isr' corresponding to a new interrupt function
  1764.     - address of a C routine may be used only if it has been declared to be
  1765.       an interrupt routine
  1766.  
  1767. :setverify
  1768.     int setverify(int value)
  1769.     - sets current state of verify flag (0==off, 1==on) to 'value'
  1770.     - prototype in dos.h
  1771.  
  1772. :sin
  1773.     double sin(x)
  1774.     double x;
  1775.  
  1776. :sinh
  1777.     double sinh(x)
  1778.     double x;
  1779.  
  1780. :sleep
  1781.     unsigned sleep(unsigned seconds);
  1782.     - prototype in dos.h
  1783.     - causes calling program to be suspended for 'seconds' of time
  1784.     - accurate in seconds to limit of MS-DOS clock
  1785.  
  1786. :spawn
  1787.     int spawnl(mode,pathname,arg0,arg1,..,NULL)
  1788.     int spawnle(mode,pathname,arg0,arg1,...,NULL,envp)
  1789.     int spawnlp(mode,pathname,arg0,arg1,...,NULL)
  1790.     int spawnlpe(mode,pathname,arg0,arg1,...,NULL,envp)
  1791.     int spawnv(mode,pathname,argv)
  1792.     int spawnve(mode,pathname,argv,envp)
  1793.     int spawnvp(mode,pathname,argv)
  1794.     int spawnvpe(mode,pathname,argv,envp)
  1795.     int mode;
  1796.     char *pathname,*arg0,*arg1,...,*envp[]'
  1797.     - creates & runs child processes
  1798.     - 'mode' is P_WAIT which puts parent process "on hold" until
  1799.       child completes execution; P_NOWAIT which continues to run
  1800.       parent while child runs (not supported yet); or P_OVERLAY
  1801.       which overlays child in memory location formerly occupied
  1802.       by parent (same as exec... call)
  1803.     - see exec...
  1804.     - use P_WAIT to perform a DOS shell
  1805.  
  1806. :sprintf
  1807.     int sprintf(s, format [, arg1, arg2, ...])
  1808.     char *s, *format;
  1809.  
  1810. :sqrt
  1811.     double sqrt(x)
  1812.     double x;
  1813.     - needs math.h
  1814.     - returns sqaure root of x, or 0 on error
  1815.  
  1816. :srand
  1817.     int rand()
  1818.     void srand(unsigned seed);
  1819.     - prototype in stdlib.h
  1820.     - rand() returns pseudorandom numbers
  1821.     - reinitialize with srand(1) or set to new starting point with
  1822.       'seed' set other than to 1
  1823.  
  1824. :sscanf
  1825.     int sscanf(s, format, arg1, arg2, ...);
  1826.     char *s, *format;
  1827.     union datatype *arg1, *arg2, ...;
  1828.  
  1829. :ssignal
  1830.     int gsignal(int sig);
  1831.     int (*ssignal(int sig, int (*action)())();
  1832.     - prototype in: signal.h
  1833.     - ssignal() and gsignal() implement a software-signaling facility where
  1834.       software signals are integers 1-15
  1835.     - gsignal() raises the signal given by 'sig' and executes the action
  1836.       routine
  1837.     - ssignal() establishes an action routine for servicing a signal where
  1838.       'sig' is associated with the 'action' routine
  1839.     - ssignal() returns action previously established for ssignal() or SIG_DFL
  1840.     - gsignal() returns value by action or SIG_IGN or SIG_DFL
  1841.     - UNIX based
  1842.  
  1843. :stat
  1844.     #include <sys\stat.h>
  1845.     int stat(char *pathname,struct stat *buff);
  1846.     int fstat(char *handle,struct stat *buff);
  1847.     - stat() and fstat() store information about a given open file
  1848.       (or directory) in the 'stat' structure (defined in stat.h)
  1849.     - stat() gets information about the open file or directory,
  1850.       while fstat() gets information about the open file associated
  1851.       with 'handle'
  1852.     - see stat.h for definition
  1853.     - returns 0 if successful, else -1 on error
  1854.  
  1855. :_status87
  1856.     unsigned int _status87()
  1857.     - prototype in float.h
  1858.     - returns floating-point status word & other conditions detected
  1859.       by 8087/80287 exception handler
  1860.     - see float.h for definition of return word from _status87()
  1861.  
  1862. :stime
  1863.     int stime(long *tp);
  1864.     - prototype in: time.h
  1865.     - sets system time & date, where 'tp' to value of time in seconds
  1866.       since 00:00:00 GMT Jan 1, 1970
  1867.  
  1868. :str...
  1869.     - string functions in Turbo C using prototype in string.h
  1870.     - except where noted, all parameters are char pointers and
  1871.       all returns are char pointers also
  1872.  
  1873.     char *stpcpy(destin,source)
  1874.     - copies 'source' into 'destin'
  1875.     - returns 'destin'+strlen('source')
  1876.  
  1877.     char *strcat(destin,source)
  1878.     - appends 'source' to 'destin'
  1879.  
  1880.     char *strchr(str,c)
  1881.     - scans 'str' for first occurrence of 'c'
  1882.     - returns pointer to 'c' in 'str', or NULL if not found
  1883.  
  1884.     int  strcmp(str1,str2)
  1885.     - compares 'str1' to 'str2'
  1886.     - returns < 0 if str1 < str2, = 0 if str1 = str2, or
  1887.       > 0 if str1 > str2, using a signed comparsion
  1888.  
  1889.     char *strcpy(destin,source)
  1890.     - copies 'source' into 'destin'
  1891.     - returns 'destin'
  1892.  
  1893.     int  strcspn(str1,str2)
  1894.     - returns length of initial segment of 'str1' that consists
  1895.       entirely of characters NOT from 'str2'
  1896.  
  1897.     char *strdup(str)
  1898.     - duplicates 'str', getting space with a call to malloc()
  1899.     - returns pointer to duplicated string, or NULL if space
  1900.       could not be allocated
  1901.  
  1902.     int  stricmp(str1,str2)
  1903.     - compares 'str1' to 'str2' without case sensitivity
  1904.     - returns < 0 if str1 < str2, = 0 if str1 = str2, or
  1905.       > 0 if str1 > str2, using a signed comparsion
  1906.  
  1907.     unsigned strlen(str)
  1908.     - returns number of characters in 'str', not counting the
  1909.       null-terminating character
  1910.  
  1911.     char *strlwr(str)
  1912.     - converts 'str' to all lower case
  1913.  
  1914.     char *strncat(destin,source,maxlen)
  1915.     - appends up to 'maxlen' characters of 'source' to 'destin'
  1916.       and then appends a null character
  1917.  
  1918.     int  strncmp(str1,str2,maxlen)
  1919.     - compares 'str1' to 'str2' up to 'maxlen' characters
  1920.     - returns < 0 if str1 < str2, = 0 if str1 = str2, or
  1921.       > 0 if str1 > str2, using a signed comparsion
  1922.  
  1923.     char *strncpy(destin,source,maxlen)
  1924.     - copies exactly 'maxlen' characters from 'source' to 'destin',
  1925.       truncating or null-padding 'destin'
  1926.     - 'destin' might NOT be null-terminated if length of 'source' is
  1927.       'maxlen' or more
  1928.  
  1929.     int  strnicmp(str1,str2,(unsigned)maxlen)
  1930.     - compares 'str1' to 'str2' up to 'maxlen' characters
  1931.     - case is ignored
  1932.     - returns < 0 if str1 < str2, = 0 if str1 = str2, or
  1933.       > 0 if str1 > str2, using a signed comparsion
  1934.  
  1935.     char *strnset(str,ch,(unsigned)n)
  1936.     - sets up to first 'n' bytes of 'str' to 'ch'
  1937.     - if 'n' > strlen(str) then strlen(str) replaces 'n'
  1938.  
  1939.     char *strpbrk(str1,str2)
  1940.     - scans 'str1' for first occurrence of any character
  1941.       appearing in 'str2'
  1942.     - returns pointer to first occurrence, or NULL if not found
  1943.  
  1944.     char *strrchr(str,c)
  1945.     - scans a string in reverse direction, looking for specific
  1946.       character 'c' -- so that strrchr finds the LAST occurrence
  1947.       of 'c' in 'str'
  1948.     - returns pointer to LAST occurrence, or NULL if not found
  1949.  
  1950.     char *strrev(str)
  1951.     - reverses all characters in 'str', except null terminator
  1952.  
  1953.     char *strset(str,ch)
  1954.     - sets all characters in 'str' to 'ch'
  1955.  
  1956.     int  strspn(str1,str2)
  1957.     - returns length of initial segment of 'str1' that consists
  1958.       entirely of characters from 'str2'
  1959.  
  1960.     char *strstr(str1,str2)
  1961.     - scans 'str2' for first occurrence of substring 'str1'
  1962.  
  1963.     double strtod(str,(char **)endptr)
  1964.     - converts string 'str' to a double value
  1965.     - stops reading at tfirst character that cannot be interpreted
  1966.       as part of a double value, returning in *endptr
  1967.     - 'str' must have format:
  1968.        [ws][sn][ddd][.][ddd][fmt[sn]ddd]
  1969.        where [ws] = optional whitespace
  1970.              [sn] = optional sign (+-)
  1971.              [ddd]= optional digits
  1972.              [fmt]= option e or E
  1973.              [.]  = optional decimal point
  1974.  
  1975.     long   strtol(str,(char **)endptr,base)
  1976.     - converts string 'str' to a long value
  1977.     - stops reading at first character that cannot be interpreted
  1978.       as part of a long value, returning in *endptr
  1979.     - 'str' must have format:
  1980.        [ws][sn][0][x][ddd]
  1981.        where [ws] = optional whitespace
  1982.              [sn] = optional sign (+-)
  1983.              [0]  = optional zero
  1984.              [x]  = optional x or X
  1985.              [ddd]= optional digits
  1986.      - 'base' is between 2 and 36; if 0, first few characters
  1987.        of 'str' determines base to be used (oct,hex or dec); any
  1988.        other value of 'base' is illegal
  1989.  
  1990.     char *strtok(str1,str2)
  1991.     - parses 'str1' for tokens and separators, where separators are
  1992.       defined in 'str2'
  1993.     - first call returns a pointer to the first character of the
  1994.       first token in 'str1' and writes a null character into 'str1'
  1995.       immediately following the returned token.  Subsequent calls
  1996.       with NULL for the first argument will work through the string
  1997.       'str1' in this way until no tokens remain.
  1998.     - when tokens are exhausted, returns NULL
  1999.  
  2000.     char *strupr(str)
  2001.     - converts to all uppercase
  2002.  
  2003. :strerror
  2004.     char *strerror(char *str);
  2005.     - prototype in string.h
  2006.     - allows you to generate customized error messages, returning a
  2007.       pointer to a null-terminated string containing an error message
  2008.     - if 'str' is NULL, the return value contains the most recently
  2009.       generated system error message; this string is null-terminated.
  2010.     - if 'str' is not NULL, the return value contains 'str' (your
  2011.       customized error message), a colon, a space, the most recently
  2012.       generated system error message, and a newline; with length of
  2013.       'str' being 94 characters or less
  2014.     - nothing is printed automatically unlike perror()
  2015.     - for accurate error-handling, strerror should be called as soon
  2016.       as a library routine generates an error return
  2017.  
  2018. :swab
  2019.     void swab(char *from,char *to,int nbytes);
  2020.     - prototype in stdlib.h
  2021.     - copies 'nbytes' bytes from 'from' into 'to', with adjacent
  2022.       even- and odd-byte positions being swapped; 'nbytes' should
  2023.       therefore be even
  2024.  
  2025. :system
  2026.     int system(char *command);
  2027.     - prototype in stdlib.h
  2028.     - invokes MS-DOS COMMAND.COM to execute 'command', returning
  2029.       exit status of COMMAND.COM.  The COMSPEC environment variable
  2030.       is automatically searched if necessary.
  2031.  
  2032. :tan
  2033.     double tan(x)
  2034.     double x;
  2035.  
  2036. :tanh
  2037.     double tanh(x)
  2038.     double x;
  2039.  
  2040. :tell
  2041.     long tell(fd)
  2042.     int fd;
  2043.     - returns offset of file associated with 'fd' from beginning of file 
  2044.     - returns -1L on error
  2045.  
  2046. :time
  2047.     longvoid times(long *tloc)
  2048.     - prototype in time.h
  2049.     - gives current time in seconds elapsed since 00:00:00 GMT,
  2050.       January 1, 1970, and stores it into 'tloc'
  2051.  
  2052. :toascii
  2053.     int toascii(int c);
  2054.     - prototype in ctype.h
  2055.     - clears all but lower 7 bits in 'c', converting to ASCII
  2056.  
  2057. :_tolower
  2058.     #include <ctype.h>
  2059.     int _tolower(c)
  2060.     int c;
  2061.     - converts 'c' to lowercase only if 'c' is known to be UPPER case
  2062.     - use tolower() preferentially
  2063.  
  2064. :tolower
  2065.     int tolower(c)
  2066.     int c;
  2067.  
  2068. :_toupper
  2069.     #include <ctype.h>
  2070.     int _toupper(c)
  2071.     int c;
  2072.     - converts 'c' to UPPERcase only if 'c' is known to be lower case
  2073.     - use toupper() preferentially
  2074.  
  2075. :toupper
  2076.     int toupper(c)
  2077.     int c;
  2078.  
  2079. :tzset
  2080.     void tzset()
  2081.     - included for UNIX time compatibility but does nothing in MS-DOS
  2082.  
  2083. :ultoa
  2084.     char *ultoa(unsigned long value,char *string,int radix);
  2085.     - converts 'value' to 'string' where 'radix' specifies base (2-36) for
  2086.       conversion
  2087.  
  2088. :ungetc
  2089.     void ungetc(c, fd)
  2090.     int c;
  2091.     FILE *fd;
  2092.  
  2093. :ungetch
  2094.     void ungetch(c)
  2095.     int c;
  2096.     - similar to ungetc() except pushes character back to keyboard
  2097.       buffer
  2098.  
  2099. :unixtodos
  2100.     #include <dos.h>
  2101.     void unixtodos(long utime,struct date *dateptr,struct time *timeptr);
  2102.     - converts date & time to DOS format
  2103.  
  2104. :unlink
  2105.     int unlink(filename)
  2106.     char *filename;
  2107.     - prototype in dos.h
  2108.     - returns 0 if successful, else -1
  2109.  
  2110. :unlock
  2111.     int lock(int handle, long offset, long length);
  2112.     int unlock(int handle, long offset, long length);
  2113.     - lock() locks arbitrary, non-overlapping regions of any file (DOS 3.X), 
  2114.       preventing reads/writes to those regions
  2115.     - unlock() removes said locks
  2116.     - returns 0 on success, else -1 on error
  2117.  
  2118. :va_...
  2119.     #include <stdarg.h>
  2120.     void va_start(va_list param,lastfix);
  2121.     type va_arg(va_list param,type);
  2122.     void va_end(va_list param);
  2123.     - Some C functions, such as vfprintf and vprintf, take variable argument
  2124.       lists in addition to taking a number of fixed (known) parameters.  The
  2125.       va_... macros provide a protable to access these argument lists.  They
  2126.       are used for stepping through a list of arguments when the called fun-
  2127.       ction does not know the number and types of the arguments being passed.
  2128.     - The header file stdarg.h declares one type (va_list) and three macros
  2129.       (va_start, va_arg, and va_end).
  2130.     - va_list: This array holds information needed by va_arg and va_end. When
  2131.       a called function takes a variable argument list, it declares a variable
  2132.       param of type va_list.
  2133.     - va_start: This routine (implemented as a macro) sets 'param' to point
  2134.       to the first of the variable arguments being passed to the function.
  2135.       va_start must be used before the first call to va_arg or va_end.  It
  2136.       takes two arguments: 'param' and 'lastfix'.  ('param' is explained
  2137.       under va_list abofe; 'lastfix' is the name of the last fixed para-
  2138.       meter being passed to the called function.)
  2139.     - va_arg: This routine (also implemented as a macro) expands to an ex-
  2140.       pression that has the same type and value as the next argument being
  2141.       passed (one of the variable arguments).  The variable 'param' to
  2142.       va_arg should be the same 'param' that va_start initialized.  The
  2143.       first time va_arg is used, it returns the first argument in the list.
  2144.       Each successive time va_arg is used, it returns the next argument in
  2145.       the list.  It does this by first de-referencing 'param', and then in-
  2146.       crementing 'param' to point to the following item.  va_arg uses the
  2147.       type to both perform the de-reference and to locate the following
  2148.       item.  Each successive time va_arg is invoked, it modifies 'param' to
  2149.       point to the next argument in the list.
  2150.     - va_end: This macros helps the called function perform a normal return.
  2151.       va_end might modify 'param' in such a way that it cannot be used unless
  2152.       va_start is re-called.  va_end should be called after va_arg has read
  2153.       all the arguments: failure to do so might cause strange, undefined
  2154.       behavior in your program.
  2155.     - va_start and va_end return no values; va_arg returns the current argu-
  2156.       ment in the list (the one that 'param' is pointing to).
  2157.  
  2158. :vfprintf
  2159.     #include <stdio.h>
  2160.     #include <stdarg.h>
  2161.     int vprintf(FILE *stream,char *format,va_list param);
  2162.     - sends formatted output to a stream
  2163.  
  2164. :vfscanf
  2165.     int vfscanf(FILE *stream,char *format,va_list argp);
  2166.     - like fscanf(), except arguments accepted from va_arg arrary from
  2167.       va_list parm
  2168.  
  2169. :vprintf
  2170.     int vprintf(char *format,va_list param);
  2171.     - prototype in stdio.h
  2172.     - sends formatted output to stdout
  2173.  
  2174. :vscanf
  2175.     int vscanf(char *format,va_list argp);
  2176.     - like scanf(), except arguments accepted from va_arg arrary from
  2177.       va_list parm
  2178.  
  2179. :vsprintf
  2180.     int vsprintf(char *string,char *format,va_list param);
  2181.     - prototype in stdio.h
  2182.     - sends formatted output to a string
  2183.  
  2184. :vsscanf
  2185.     int vsscanf(char *string,char *format,va_list argp);
  2186.     - like sscanf(), except arguments accepted from va_arg arrary from
  2187.       va_list parm
  2188.  
  2189. :write
  2190.     int _write(fd, buf, count)
  2191.     int write(fd, buf, count)
  2192.     int fd, count;
  2193.     char *buf;
  2194.     - write() and _write() write a buffer 'buf' of data to file or
  2195.       device named by 'fd', writing 'count' of bytes.
  2196.     - for text files, write converts LF to CR-LF pair on output;
  2197.       _write does not.
  2198.     - returns count of bytes written out (excluding any CR's
  2199.       generated for a text file), or -1 on error
  2200.  
  2201.